/*
 * GuiButton.h
 *
 *  Created on: 04/ago/2011
 *      Author: marcolembo
 */

#ifndef GUIBUTTON_H_
#define GUIBUTTON_H_

#ifndef _WP_
#define _WP_
#include "WProgram.h"
#endif

namespace ml
{

    class GuiButton
    {
        public:
            inline GuiButton(uint8_t _pin)
            :m_pin(_pin)
            {};

            inline uint8_t Read(uint8_t _pin = 0)
            {
                if(_pin != 0)
                    m_pin = _pin;
                return digitalRead(m_pin);
            }

            virtual
            ~GuiButton();
        protected:
            uint8_t m_pin;

    };

}

#endif /* GUIBUTTON_H_ */
